<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Document</title>

        <style>
            p {
                color: red;
            }
        </style>
    </head>
    <body>
        <div id="box">
            <p>hello</p>
            <p>world</p>
        </div>

        <ul id="news"></ul>

        <script>
            // var box = document.querySelector('#box');

            // console.log(box);

            // box.innerHTML +=  '<p>世界和平</p>';

            // 新闻数据
            var newsData = [
                { 
                    text:'一跃跨千年 习近平心系西藏发展',
                    url: 'https://new.qq.com/omn/20210819/20210819A0CH4J00.html'
                },
                {
                    text:'西藏故事 | 向阳之路',
                    url: 'https://new.qq.com/omn/20210819/20210819A0DSFQ00.html'
                },
                {
                    text:'美方借溯源搞政治操弄的险恶用心昭然若揭',
                    url: 'https://new.qq.com/omn/20210820/20210820A01HXK00.html'
                }
            ]

            // 获取列表对象
            var newUl = document.querySelector('#news');

            var content = ''

            for (var i = 0; i < newsData.length; i++) {
                var item = newsData[i];

                var text = item.text;

                // content += '<li>' + text + '</li>';
                content += '<li><a href="' + item.url + '">' + item.text + '</a></li>';
            }

            newUl.innerHTML = content;
        </script>
    </body>
</html>